﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CalculatorFlexibe
{
    class ExpressionPreParse
    {
        public string DeleteSpaces(string str)
        {
            char[] array = new char[str.Length];
            int count = 0;
            for (int i = 0; i < str.Length; i++)
            {
                if (str[i] != ' ')
                {
                    array[count] = str[i];
                    count++;
                }
            }
            Array.Resize<char>(ref array, count);
            return new string(array);
        }
        public string ChangeStringParts(string str)
        {
            str = str.Replace("-+", "-");
            str = str.Replace("+-", "-");
            return str;
        }
        public string CallAllMethods(string str)
        {
            str = DeleteSpaces(str);
            str = ChangeStringParts(str);
            return str;
        }
    }
}
